home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / lib / H / tmp / status.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1014 b   |  43 lines

  1. /*
  2.  * status.h --
  3.  *    POSTGRES library function return status.
  4.  *     $Header: /private/postgres/src/lib/H/tmp/RCS/status.h,v 1.5 1990/08/17 08:54:57 cimarron Exp $
  5.  */
  6.  
  7. #ifndef    StatusIncluded    /* Include this file only once. */
  8. #define StatusIncluded    1
  9.  
  10. #include "tmp/c.h"
  11.  
  12. /*
  13.  * ReturnStatus --
  14.  *    Return status from POSTGRES library functions.
  15.  *
  16.  * Note:
  17.  *    Most POSTGRES functions will not return a status.
  18.  *    In the future, there should be a global variable
  19.  *    which indicates the reason for the failure--the
  20.  *    identifier of an error message in the ERROR relation.
  21.  */
  22. typedef int    ReturnStatus;
  23.  
  24. /*
  25.  * ReturnStatusIsValid --
  26.  *    True iff return status is valid.
  27.  *
  28.  * Note:
  29.  *    Assumes that a library function can only indicate
  30.  *    sucess or failure.
  31.  */
  32. #define ReturnStatusIsValid(status) \
  33.     ((-1) <= (status) && (status) <= 0)
  34.  
  35. /*
  36.  * ReturnStatusIsSucess --
  37.  *    True iff return status indicates a sucessful call.
  38.  */
  39. #define SucessfulReturnStatus(status) \
  40.     ((status) >= 0)
  41.  
  42. #endif    /* !defined(StatusIncluded) */
  43.